UI: Add comprehensive domain deletion confirmation dialog (Feature Request #11497)#12380
UI: Add comprehensive domain deletion confirmation dialog (Feature Request #11497)#12380DaanHoogland merged 4 commits intoapache:4.20from
Conversation
|
@Imvedansh a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
|
@DaanHoogland WDYT? |
|
@Imvedansh , I moved it to 4.20 as this is the oldest supported LTS. |
|
@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12380 +/- ##
============================================
+ Coverage 16.23% 16.26% +0.02%
- Complexity 13382 13424 +42
============================================
Files 5657 5661 +4
Lines 498999 499996 +997
Branches 60566 60711 +145
============================================
+ Hits 81035 81302 +267
- Misses 408928 409623 +695
- Partials 9036 9071 +35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
UI build: ✔️ |
I was working on
Yeah , was thinking same. |
shwstppr
left a comment
There was a problem hiding this comment.
Need update for async deleteDomain (try deleting a domain which has an account)
ui/src/views/iam/DomainView.vue
Outdated
| confirmDeleteDomain () { | ||
| const params = { id: this.deleteDomainResource.id } | ||
|
|
||
| api('deleteDomain', params) |
There was a problem hiding this comment.
@Imvedansh deleteDomain is an async API. You would mostly always get a 200 response as it would return the jobid. So you'll have to poll that job ID instead showing success immediately
There was a problem hiding this comment.
Ahh, alrightyy.
I ll shoot changes shortly
There was a problem hiding this comment.
Thanks for the clarification @shwstppr
I’ve updated the UI to treat deleteDomain as an async API by polling the returned jobId using the existing $pollJob helper, consistent with other async actions in the UI.
Success and failure are now shown only after the async job completes.
WDYS?
Implements a confirmation modal for domain deletion that shows detailed impact before proceeding, making it consistent with account deletion
2af3738 to
3562cd3
Compare
|
@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
Thanks Daan for checking this out Deleting an empty domain works as expected. When a domain contains accounts, users, or sub-domains, the deletion fails because the CloudStack backend does not allow cascading deletion of users or accounts during domain deletion, in order to avoid catastrophic actions. The error shown is therefore correct and comes from the backend async job result. The UI change in this PR does not attempt to change backend deletion semantics. Instead, it focuses on: Correctly handling deleteDomain as an async job . Improving user awareness by clearly showing associated accounts and instances before attempting deletion Providing better verbiage around domain deletion expectations, as requested in #11497 Previously, after an unsuccessful domain deletion, users had to manually navigate through accounts and instances to identify what was still associated with the domain, quite not cool With the current change, the UI presents the list of associated accounts and active/stopped instances upfront, making it easier to clean up the domain by deleting the related accounts first and then retrying the domain deletion. So far this is my understanding , |
|
Ok @Imvedansh , I do not care either way, but as https://cloudstack.staged.apache.org/api/apidocs-4.22/apis/deleteDomain.html states there is a |
Gotcha, |
Just need to add cleanup:true in domainDelete funtion. |
|
Delete dialog needs cleanup options. @Imvedansh I don't think you need to check if all resources are actually cleaned up. That is an existing flag and you just need to make sure API is called with the correct value. |
|
@Imvedansh , can you look at @RosiKyu ’s last test case? |
|
@RosiKyu Thanks,I really appreciate your efforts,Detailed insights |
Yeah,I was aware of expected behavior before hand,Working on the fixes. |
thanks |
Deletion message which shows actual behavior
a84c486 to
079db58
Compare
|
@Imvedansh a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
Recording.2026-01-31.123039.1.mp4 |
|
@RosiKyu can you have another look? |
as discussed in #12380 (comment) and in the issue.
| import { api } from '@/api' | ||
|
|
||
| export default { | ||
| name: 'DomainDeleteConfirm', |
There was a problem hiding this comment.
Hi @Imvedansh Can have this as a generic vue component for delete confirmation of other resources as well?
There was a problem hiding this comment.
For this PR,I've kept the component domain-specific,
If a similar requirement comes up for other resources in future,I'd be cool to refactor it into reusable component and follow up with separate PR. WDYT?
Quite a catch
|
@blueorangutan package |
|
@RosiKyu a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16679 |
There was a problem hiding this comment.
LGTM
The previously identified issues have been addressed. Functionality is solid. Great work, @Imvedansh!
Verified Fix
The navigation bug from TC6 has been addressed. Additionally, the warning message verbiage has been updated.
What Was Tested
| Check | Result |
|---|---|
| Delete domain while viewing it → UI navigates away | PASS |
| Updated warning text displays correctly | PASS |
| Exact name validation (similar names don't match) | PASS |
| Cancel button works (no unintended deletion) | PASS |
| Basic domain deletion still works | PASS |
Observations
- Navigation fix confirmed - After deleting a domain while viewing it, the UI now properly navigates away (no more stale data in detail panel)
- Warning text improved - Now reads: "All associated accounts, users, VMs, and sub-domains will be permanently deleted. This action cannot be undone." - much clearer than the previous version
- Exact name validation - Tested with similarly named domains (NavigationTest, NavigationTest1, NavigationTest2). Typing a partial or similar name does NOT enable the delete button. Only the exact domain name activates deletion.
- No regressions found
Screencast.from.2026-02-05.12-33-27.webm
Test Cases Execution Summary:
Test Results
| Test Case | Description | Result |
|---|---|---|
| TC1 | Delete empty domain | PASS |
| TC2 | Delete domain with account (no VMs) | PASS |
| TC3 | Delete domain with mixed VM states | PASS |
| TC4 | Cascading deletion (parent with children) | PASS |
| TC5 | Mass delete (rapid succession) | PASS |
| TC6 | Whitespace handling + navigation | PASS |



Implements a confirmation modal for domain deletion that shows detailed impact before proceeding, making it consistent with account deletion
Description
This PR implements a comprehensive domain deletion confirmation dialog, making the domain deletion process consistent with account deletion and providing better warnings to users about the impact of their actions.
Fixes #11497
New Component: DomainDeleteConfirm
listAccountsandlistVirtualMachinesAPIsTypes of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?